Search API
Search service API Documentation
Version: 1.0.4
Paths
/cl/search/api/v1/healthz/
- Method: GET
- Summary: Health
- Description: Return Health Status. :return:
- Operation ID: health_cl_search_api_v1_healthz__get
- Responses:
- 200:
- Description: Successful Response
- Content-Type: application/json
- 200:
Semantic Search API
/cl/search/api/v1/semantic
- Method:
POST
- Summary: Semantic Search On Tenant Data
- Description: Perform a semantic search on tenant data present in the object repository and return a list of matching documents.
- Operation ID: Semantic_search_on_tenant_data_present_cl_search_api_v1_semantic_post
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Query Parameter | query_string | Query string to search for objects semantically | string | mandatory |
Query Parameter | start | Specifies the page number to retrieve (1-based index) | int | mandatory |
Query Parameter | size | Specifies the number of items per page | int | mandatory |
Query Parameter | min_relevant_score | Minimum relevant score | int | mandatory |
Parameter | tags | List of tags associated with the document | array of strings | mandatory |
Parameter | folders | List of folders where the document is organized | array of strings | mandatory |
Parameter | repos | List of repositories where the document is stored | array of strings | mandatory |
Parameter | kvp | Key-value pairs for additional metadata | object | mandatory |
Parameter | taxonomy | Taxonomy information related to the document | array of objects | mandatory |
sample code
import requests
URL = "https://api.kadal.ai/cl/search/api/v1/semantic"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"query_string":"string",
"start":int,
"size":int,
"min_relevant_score":int,
"tags": [
"string"
],
"folders": [
"string"
],
"repos": [
"string"
],
"kvp": {},
"taxonomy": {}
}
response = requests.post(URL, headers=headers,params=params)
print(response)
Example response -
{
"status": "200",
"message": "Documents found",
"result_count": 0,
"result": [],
"aggregation": {}
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Documents found | application/json |
400 | Bad Request | application/json |
401 | Unauthorized | application/json |
403 | Forbidden | application/json |
404 | Object not found | application/json |
405 | Method not allowed | application/json |
422 | Unprocessable Entity | application/json |
500 | Internal server error | application/json |
- 200 (Documents found): This response indicates that the semantic search operation was successful, and it returns a list of matching documents.
- 400 (Bad Request): This response indicates that the request was malformed or invalid.
- 401 (Unauthorized): This response indicates that the request lacks valid authentication credentials for the operation.
- 403 (Forbidden): This response indicates that the request is forbidden due to insufficient permissions.
- 404 (Object not found): This response indicates that the requested object or resource was not found.
- 405 (Method not allowed): This response indicates that the HTTP method used is not allowed for this endpoint.
- 422 (Unprocessable Entity): This response indicates that the request was well-formed but unable to be followed due to semantic errors.
- 500 (Internal server error): This response indicates an unexpected server error occurred.
Note: Use this API to perform a semantic search on tenant data present in the object repository. Ensure that the request parameters are correctly formatted and that authentication credentials are provided as required.
Full-Text Search API
/cl/search/api/v1/fulltext
- Method:
POST
- Summary: Full-Text Search On Tenant Data
- Description: Perform a full-text search on tenant data present in the object repository and return a list of matching documents.
- Operation ID: Full_text_search_on_tenant_data_present_cl_search_api_v1_fulltext_post
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Query Parameter | query_string | Query string to search for objects semantically | string | mandatory |
Query Parameter | start | Specifies the page number to retrieve (1-based index) | string | mandatory |
Query Parameter | size | Specifies the number of items per page | int | mandatory |
Query Parameter | min_relevant_score | Minimum relevant score | int | mandatory |
Parameter | tags | List of tags associated with the document | list | mandatory |
Parameter | folders | List of folders where the document is organized | list | mandatory |
Parameter | repos | List of repositories where the document is stored | list | mandatory |
Parameter | kvp | Key-value pairs for additional metadata | list | mandatory |
Parameter | taxonomy | Taxonomy information related to the document | list | mandatory |
sample code
import requests
URL = "https://api.kadal.ai/cl/search/api/v1/fulltext"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"query_string":"string",
"start":int,
"size":int,
"min_relevant_score":int,
"tags": [
"string"
],
"folders": [
"string"
],
"repos": [
"string"
],
"kvp": list,
"taxonomy": list,
}
response = requests.post(URL, headers=headers,params=params)
print(response)
Example response -
{
"status": "200",
"message": "Documents found",
"result_count": 0,
"result": [],
"aggregation": {}
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Documents found | application/json |
400 | Bad Request | application/json |
401 | Unauthorized | application/json |
403 | Forbidden | application/json |
404 | Object not found | application/json |
405 | Method not allowed | application/json |
422 | Unprocessable Entity | application/json |
500 | Internal server error | application/json |
- 200 (Documents found): This response indicates that the full-text search operation was successful, and it returns a list of matching documents.
- 400 (Bad Request): This response indicates that the request was malformed or invalid.
- 401 (Unauthorized): This response indicates that the request lacks valid authentication credentials for the operation.
- 403 (Forbidden): This response indicates that the request is forbidden due to insufficient permissions.
- 404 (Object not found): This response indicates that the requested object or resource was not found.
- 405 (Method not allowed): This response indicates that the HTTP method used is not allowed for this endpoint.
- 422 (Unprocessable Entity): This response indicates that the request was well-formed but unable to be followed due to semantic errors.
- 500 (Internal server error): This response indicates an unexpected server error occurred.
Note: Use this API to perform a full-text search on tenant data present in the object repository. Ensure that the request parameters are correctly formatted and that authentication credentials are provided as required.
Basic Search API
/cl/search/api/v1/basic_search
Method:
POST
Summary: Basic Search On Tenant Data
Description: Perform a basic search on tenant data present in the object repository and return a list of matching documents based on a specified query.
Operation ID: Basic_search_on_tenant_data_present_cl_search_api_v1_basic_search_post
Request Payload:
Query Parameter | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
query_string | provide string query | object (dictionary) | Yes | |
kvp | Key-value pairs for additional metadata | dictionary | Yes | |
tags | List of tags associated with the request | strings | Yes | |
repos | List of repositories linked to the request | strings | Yes | |
folders | List of folders associated with the request | strings | Yes | |
created_between | Filter results by creation date range | list | Yes | |
modified_between | Filter results by modification date range | list | Yes | |
deleted_between | Filter results by deletion date range | list | Yes | |
start | Index of the first item to retrieve in the result set | integer | No | |
size | Number of items to retrieve per page | integer | No |
sample code
import requests
URL = "https://api.kadal.ai/cl/search/api/v1/basic_search"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"query_dictionary": {
"kvp": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"tags": [
"string"
],
"repos": [
"string"
],
"folders": [
"string"
],
"start": int,
"size": int,
"source": "string",
"created_between": list,
"modified_between": list,
"deleted_between",:list,
}
}
response = requests.post(URL, headers=headers,params=params)
print(response)
Example response -
{
"status": "200",
"message": "Documents found",
"result_count": 0,
"result": [],
"aggregation": {}
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Documents found | application/json |
400 | Bad Request | application/json |
401 | Unauthorized | application/json |
403 | Forbidden | application/json |
404 | Object not found | application/json |
405 | Method not allowed | application/json |
422 | Unprocessable Entity | application/json |
500 | Internal server error | application/json |
- 200 (Documents found): This response indicates that the basic search operation was successful, and it returns a list of matching documents based on the query.
- 400 (Bad Request): This response indicates that the request was malformed or invalid.
- 401 (Unauthorized): This response indicates that the request lacks valid authentication credentials for the operation.
- 403 (Forbidden): This response indicates that the request is forbidden due to insufficient permissions.
- 404 (Object not found): This response indicates that the requested object or resource was not found.
- 405 (Method not allowed): This response indicates that the HTTP method used is not allowed for this endpoint.
- 422 (Unprocessable Entity): This response indicates that the request was well-formed but unable to be followed due to semantic errors.
- 500 (Internal server error): This response indicates an unexpected server error occurred.
Note: Use this API to perform a basic search on tenant data present in the object repository using a specified query. Ensure that the request parameters are correctly formatted and that authentication credentials are provided as required.
Search APIs
/cl/search/api/v1/search
Method:
POST
Summary: Search With Reranking
Description: Re-rank search results obtained through semantic and full-text search.
Operation ID: search_with_reranking_cl_search_api_v1_search_post
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Query Parameter | query_string | Query string to search | string | mandatory |
Query Parameter | top_k | Default value for top_k (Default: 5) | int | mandatory |
Query Parameter | re_ranked | Re-rank the search results | boolean | mandatory |
Parameter | tags | List of tags associated with the document | list | mandatory |
Parameter | folders | List of folders where the document is organized | list | mandatory |
Parameter | repos | List of repositories where the document is stored | list | mandatory |
Parameter | kvp | Key-value pairs for additional metadata | list | mandatory |
Parameter | taxonomy | Taxonomy information related to the document | list | mandatory |
sample code
import requests
URL = "https://api.kadal.ai/cl/search/api/v1/search"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"query_string":"string",
"top_k":int,
"re_ranked":bool,
"tags": [
"string"
],
"object_ids": [
"string"
],
"folders": [
"string"
],
"repos": [
"string"
],
"kvp": list,
"taxonomy": list,
}
response = requests.post(URL, headers=headers,params=params)
print(response)
Example response -
{
"status": "string",
"message": "string",
"data": "string"
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
422 | Validation Error | application/json |
- 200 (Successful Response): This response indicates that the search with reranking operation was successful.
- 422 (Validation Error): This response indicates that there was a validation error with the request.
/cl/search/api/v1/search_lite
Method:
GET
Summary: Search With Reranking
Description: Search the database for similar documents using k-nn search provided by OpenSearch.
Operation ID: search_with_reranking_cl_search_api_v1_search_lite_get
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | query_string | Query string to search | string | mandatory |
Parameter | top_k | Default value for top_k (Default: 5) | int | mandatory |
Parameter | re_ranked | Re-rank the search results for similar documents | boolean | mandatory |
sample code
import requests
URL = "https://api.kadal.ai/cl/search/api/v1/search_lite"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"query_string":"string",
"top_k":int,
"re_ranked":bool
}
response = requests.get(URL, headers=headers,params=params)
print(response)
Example response -
{
"status": "string",
"message": "string",
"data": "string"
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
422 | Validation Error | application/json |
- 200 (Successful Response): This response indicates that the search with reranking operation was successful.
- 422 (Validation Error): This response indicates that there was a validation error with the request.
Note:
- Use
/cl/search/api/v1/search
to perform a search with reranking on search results obtained through semantic and full-text search. - Use
/cl/search/api/v1/search_lite
to perform a search for similar documents using k-nn search provided by OpenSearch. Ensure that the request parameters are correctly formatted and that authentication credentials are provided as required.
Components
Schemas
BasicSearchRequest
- Type: object
- Description:
- Properties:
- kvp:
- Type: object
- tags:
- Type: array
- repos:
- Type: array
- folders:
- Type: array
- created_between:
- Type: array
- modified_between:
- Type: array
- deleted_between:
- Type: array
- start:
- Type: integer
- size:
- Type: integer
- kvp:
Body_Full_text_search_on_tenant_data_present_cl_search_api_v1_fulltext_post
- Type: object
- Description:
- Properties:
- tags:
- Type: array
- folders:
- Type: array
- repos:
- Type: array
- kvp:
- Type: object
- taxonomy:
- Type: object
- tags:
Body_Semantic_search_on_tenant_data_present_cl_search_api_v1_semantic_post
- Type: object
- Description:
- Properties:
- tags:
- Type: array
- folders:
- Type: array
- repos:
- Type: array
- kvp:
- Type: object
- taxonomy:
- Type: object
- tags:
Body_search_with_reranking_cl_search_api_v1_search_post
- Type: object
- Description:
- Properties:
- tags:
- Type: array
- object_ids:
- Type: array
- folders:
- Type: array
- repos:
- Type: array
- kvp:
- Type: object
- taxonomy:
- Type: object
- tags:
HTTPValidationError
- Type: object
- Description:
- Properties:
- detail:
- Type: array
- detail:
Msg
- Type: object
- Description:
- Properties:
- msg:
- Type: string
- msg:
QueryResponse
- Type: object
- Description:
- Properties:
- status:
- Type: string
- message:
- Type: string
- result_count:
- Type: integer
- result:
- aggregations:
- status:
ValidationError
- Type: object
- Description:
- Properties:
- loc:
- Type: array
- msg:
- Type: string
- type:
- Type: string
- loc:
reRankResponse
- Type: object
- Description:
- Properties:
- status:
- Type: string
- message:
- Type: string
- data:
- status: